package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SmsPrizeHistoryMapper;
import com.ruoyi.system.domain.SmsPrizeHistory;
import com.ruoyi.system.service.ISmsPrizeHistoryService;

/**
 * 奖品兑换记录Service业务层处理
 *
 * @author DRIES
 * @date 2022-03-09
 */
@Service
public class SmsPrizeHistoryServiceImpl implements ISmsPrizeHistoryService
{
    @Autowired
    private SmsPrizeHistoryMapper smsPrizeHistoryMapper;

    /**
     * 查询奖品兑换记录
     *
     * @param id 奖品兑换记录主键
     * @return 奖品兑换记录
     */
    @Override
    public SmsPrizeHistory selectSmsPrizeHistoryById(Long id)
    {
        return smsPrizeHistoryMapper.selectSmsPrizeHistoryById(id);
    }

    /**
     * 查询奖品兑换记录列表
     *
     * @param smsPrizeHistory 奖品兑换记录
     * @return 奖品兑换记录
     */
    @Override
    public List<SmsPrizeHistory> selectSmsPrizeHistoryList(SmsPrizeHistory smsPrizeHistory)
    {
        return smsPrizeHistoryMapper.selectSmsPrizeHistoryList(smsPrizeHistory);
    }

    /**
     * 新增奖品兑换记录
     *
     * @param smsPrizeHistory 奖品兑换记录
     * @return 结果
     */
    @Override
    public int insertSmsPrizeHistory(SmsPrizeHistory smsPrizeHistory)
    {
        smsPrizeHistory.setCreateTime(DateUtils.getNowDate());
        return smsPrizeHistoryMapper.insertSmsPrizeHistory(smsPrizeHistory);
    }

    /**
     * 修改奖品兑换记录
     *
     * @param smsPrizeHistory 奖品兑换记录
     * @return 结果
     */
    @Override
    public int updateSmsPrizeHistory(SmsPrizeHistory smsPrizeHistory)
    {
        smsPrizeHistory.setUpdateTime(DateUtils.getNowDate());
        return smsPrizeHistoryMapper.updateSmsPrizeHistory(smsPrizeHistory);
    }

    /**
     * 批量删除奖品兑换记录
     *
     * @param ids 需要删除的奖品兑换记录主键
     * @return 结果
     */
    @Override
    public int deleteSmsPrizeHistoryByIds(Long[] ids)
    {
        return smsPrizeHistoryMapper.deleteSmsPrizeHistoryByIds(ids);
    }

    /**
     * 删除奖品兑换记录信息
     *
     * @param id 奖品兑换记录主键
     * @return 结果
     */
    @Override
    public int deleteSmsPrizeHistoryById(Long id)
    {
        return smsPrizeHistoryMapper.deleteSmsPrizeHistoryById(id);
    }
}
